package com.config;

import com.entity.Clazz;
import com.entity.Teacher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

@Configuration
public class RegestBean {
    @Bean
    public Teacher teacher(){
        return new Teacher("Teacher ma");
    }

    @Bean
    public Clazz clazz(){
        Clazz clazz = new Clazz();
        List<String> list = new ArrayList<>();
        list.add("java");
        list.add("mysql");
        clazz.setTeacher(teacher());
        clazz.setCourse(list);
        return clazz;
    }
}
